require File.dirname(__FILE__) + '/library.rb'

print "Ban nhap key can thuc thi\n HinhVuong key [1]\n HinhTron key [2]\n HinhChunhat key [3]\n"
$key = gets.to_i
if $key == 1
  hv = HinhVuong.new
  a = gets.to_i
  print "#{hv.Dientich (a)}\n"
  print "#{hv.Chuvi (a)}"
end
if $key == 2
  ht = Hinhtron.new
  a = gets.to_i
  print "#{ht.Dientich(a)}\n"
  print "#{ht.Chuvi(a)}"
end

if $key == 3
  hcn = HinhChuNhat.new
  a = gets.to_i
  b = gets.to_i
  print "#{hcn.Dientich(a,b)}\n"
  print "#{hcn.Chuvi(a,b)}"
end